import request from '../request.js'
// /his-cwgl-bed/getEemptyBedsDetails 获取床位详情
export function getEemptyBedsDetails(params) {
  return request({
    url: '/his-cwgl-bed/getEemptyBedsDetails',
    method: 'POST',
    data: params
  })
}
// 住院预约记录-一键释放
export function updateReleaseBed(params) {
  return request({
    url: '/patient-bed-middle/updateReleaseBed',
    method: 'POST'
  })
}
export function getEemptyBedsDetailsNew(params) {
  return request({
    url: '/his-cwgl-bed/getEemptyBedsDetailsNew',
    method: 'POST',
    data: params
  })
}

export function getReservationDetail(params) {
  return request({
    url: '/his-cwgl-bed/getReservationDetail',
    method: 'POST',
    data: params
  })
}
export function getReservationRjssDetail(params) {
  return request({
    url: '/his-cwgl-bed/getReservationRjssDetail',
    method: 'POST',
    data: params
  })
}
// his-cwgl-bed/getEemptyBedsList 获取空闲床位
export function getEemptyBedsList(params) {
  return request({
    url: '/his-cwgl-bed/getEemptyBedsList',
    method: 'POST',
    data: params
  })
}
// /his-cwgl-bed/getEemptyBedsListNew 获取空闲床位
export function getEemptyBedsListNew(params) {
  return request({
    url: '/his-cwgl-bed/getEemptyBedsListNew',
    method: 'POST',
    data: params
  })
}
// /this-ii-prepayin/getEemptyPatientList
export function getEemptyPatientList(params) {
  return request({
    url: '/this-ii-prepayin/getEemptyPatientList',
    method: 'POST',
    data: params
  })
}

// /this-ii-prepayin/getEemptyPatientListNew
export function getEemptyPatientListNew(params) {
  return request({
    url: '/this-ii-prepayin/getEemptyPatientListNew',
    method: 'POST',
    data: params
  })
}

export function getEemptyPatientListAll(params) {
  return request({
    url: '/this-ii-prepayin/getEemptyPatientListAll',
    method: 'POST',
    data: params
  })
}

// his-cwgl-dept/getDeptList  获取科室
export function getDeptList(params) {
  return request({
    url: '/his-cwgl-dept/getDeptList',
    method: 'POST',
    data: params
  })
}

// getDeptListByYard 获取科室新
export function getDeptListByYard(params) {
  return request({
    url: `/his-cwgl-dept/getDeptListByYard?yard=${params.yard}`,
    method: 'get',
    data: params
  })
}
// his-cwgl-dept/getAllDeptList  获取所有科室
export function getAllDeptList(params) {
  return request({
    url: '/his-cwgl-dept/getAllDeptList',
    method: 'POST',
    data: params
  })
}

// /his-cwgl-nurse/getWardList  获取病区
export function getWardList(params) {
  return request({
    url: `/his-cwgl-nurse/getWardList?yard=${params.yard}`,
    method: 'get',
    data: params
  })
}

export function getPatientAreaDTO(params) {
  return request({
    url: `/his-cwgl-dept/getPatientAreaDTO?deptCode=${params.deptCode}&areaCode=${params.areaCode}&yard=${params.yard}`,
    method: 'get',
    data: params
  })
}
export function getHisCwglDeptByAreaCode(params) {
  return request({
    url: `/his-cwgl-dept/getHisCwglDeptByAreaCode?areaCode=${params.areaCode}&yard=${params.yard}`,
    method: 'get',
    data: params
  })
}

// 数据统计空床查询报表列表获取
export function getDataSource(params) {
  return request({
    url: `/dataSource/getDataSource`,
    method: 'POST',
    data: params
  })
}
// export function getEmptyBedReportNew(params) {
//   return request({
//     url: `/dataSource/getEmptyBedReportNew`,
//     method: 'POST',
//     data: params
//   })
// }

// 数据统计空床查询报表列表下载
export function downDataSourceFormExcel(params) {
  return request({
    url: `/dataSource/downDataSourceFormExcel`,
    method: 'POST',
    data: params,
    responseType: 'blob'
  })
}
// 数据统计集管床位计算报表列表获取
export function getManageBedCalculationDTO(params) {
  return request({
    url: `/dataSource/getManageBedCalculationDTO`,
    method: 'POST',
    data: params
  })
}
// 数据统计集管床位计算报表列表下载
export function getManageBedCalculationDtoExcel(params) {
  return request({
    url: `/dataSource/getManageBedCalculationDtoExcel`,
    method: 'POST',
    data: params,
    responseType: 'blob'
  })
}
// 获取入院情况和联系人字典
export function getBaseDictByIiPrepayin(params) {
  return request({
    url: `/base-dict/getBaseDictByIiPrepayin`,
    method: 'get',
    data: params
  })
}
// 获取医生姓名
export function getDoctList(params) {
  return request({
    url: `/base-dict/getDoctList?deptCode=${params.deptCode}&name=${params.name}`,
    method: 'get',
    data: params
  })
}

// 转床通过病区编码获取病区下的床位
export function getBedByNurseCellCode(params) {
  return request({
    url: `/base-dict/getBedByNurseCellCode?nurseCellCode=${params.nurseCellCode}`,
    method: 'get',
    data: params
  })
}

// 获取入院诊断
export function getDisgnosis(params) {
  return request({
    url: `/base-dict/getDisgnosis?name=${params.name}`,
    method: 'get',
    data: params
  })
}
// /this-ii-prepayin/getById/{id}
export function getEemptyBedsDetailsinfo(params) {
  return request({
    url: '/this-ii-inmaininfo/getEemptyBedsDetails',
    method: 'get',
    params
  })
}

// his-cwgl-bed/getEemptyBeds
export function getEemptyBeds(params) {
  return request({
    url: '/his-cwgl-bed/getEemptyBeds',
    method: 'post',
    data: params
  })
}

// patient-bed/changePatientBed 转床
export function changePatientBed(params) {
  return request({
    url: `/patient-bed-middle/changePatientBed?bedId=${params.bedId}&name=${params.name}&patientId=${params.patientId}&deptName=${params.deptName}&deptCode=${params.deptCode}&sdeptCode=${params.sdeptCode}`,
    method: 'post',
    data: params
  })
}

// patient-bed/addPatientBed 登记
export function addPatientBed(params) {
  return request({
    url: `/patient-bed-middle/addPatientBed?bedId=${params.bedId}&name=${params.name}&patientId=${params.patientId}`,
    method: 'post',
    data: params
  })
}

// 未登记查看床位
export function getEemptysByPatien(params) {
  return request({
    url: `/his-cwgl-bed/getEemptysByPatien`,
    method: 'post',
    data: params
  })
}

// role/getAllRoles 分页查询角色
export function getAllRoles(params) {
  return request({
    url: 'sys-role/getAllRoles',
    method: 'post',
    data: params
  })
}

//  role/getRoleAndAuthority  角色id查询权限
export function getRoleAndAuthority(params) {
  return request({
    url: 'sys-role/getRoleAndAuthority',
    method: 'get',
    params
  })
}
// /sys-role/getRolesList
// role/getRolesList  查询角色列表
export function getRolesList(params) {
  return request({
    url: '/sys-role/getRolesList',
    method: 'post',
    data: params
  })
}

// 查询操作日志
export function selectList(params) {
  return request({
    url: '/system-log/operationLogSelectList',
    method: 'post',
    data: params
  })
}

// 查看用户列表
export function getListPage(params) {
  return request({
    url: `/sys-user/totalSysuser`,
    method: 'post',
    data: params
  })
}
// 修改用户状态
export function editSysUser(params) {
  return request({
    url: `/sys-user/editSysUser`,
    method: 'put',
    data: params
  })
}
// 删除用户
export function delUser(params) {
  return request({
    url: `/sys-user/deleteById/${params.id}`,
    method: 'post',
    data: params
  })
}

// 新增用户
export function addSysUser(params) {
  return request({
    url: '/sys-user/addSysUser',
    method: 'post',
    data: params
  })
}
// 编辑用户
export function updateSysUser(params) {
  return request({
    url: '/sys-user/updateSysUser',
    method: 'post',
    data: params
  })
}

// 用户详情
export function getBySysUser(params) {
  return request({
    url: `/sys-user/getBySysUser?userId=${params.userId}`,
    method: 'post',
    data: params
  })
}

// /sys-menu/getUserMenuByUserId  查询用户对应的菜单
export function getUserMenuByUserId(params) {
  return request({
    url: '/sys-menu/getUserMenuByUserId',
    method: 'get',
    params
  })
}

//                     his 系统专用
// /his-cwgl-bed/getEemptyBedsDetails 获取床位详情
export function getEemptyBedsDetailsHis(params) {
  return request({
    url: '/his-cwgl-bed/getEemptyBedsDetailsHis',
    method: 'POST',
    data: params
  })
}

// his-cwgl-bed/getEemptyBedsList 获取空闲床位
export function getEemptyBedsListHis(params) {
  return request({
    url: '/his-cwgl-bed/getEemptyBedsListHis',
    method: 'POST',
    data: params
  })
}

// his-cwgl-dept/getDeptList  获取科室
export function getDeptListHis(params) {
  return request({
    url: '/his-cwgl-dept/getDeptListHis',
    method: 'POST',
    data: params
  })
}

// /his-cwgl-nurse/getWardList  获取病区
export function getWardListHis(params) {
  return request({
    url: `/his-cwgl-nurse/getWardListHis?yard=${params.yard}`,
    method: 'get',
    data: params
  })
}

// 获取床位总数
export function getAllManageBed(params) {
  return request({
    url: `/his-cwgl-bed/getAllManageBed?yard=${params.yard}`,
    method: 'get',
    data: params
  })
}
// 取消占床
export function unUsedOccupationBed(params) {
  return request({
    url: `/occupation-bed/unUsedOccupationBed?occupationId=${params.occupationId}&bedNo=${params.bedNo}`,
    method: 'post',
    data: params
  })
}
// 个人工作量统计
export function getWorkSumReportDto(params) {
  return request({
    url: `/dataSource/getWorkSumReportDto`,
    method: 'post',
    data: params
  })
}
// 个人工作量统计下载
export function getWorkSumReportDtoExcel(params) {
  return request({
    url: `/dataSource/getWorkSumReportDtoExcel`,
    method: 'post',
    data: params,
    responseType: 'blob'
  })
}

// 占床新增
export function insertOccupationBed(params) {
  return request({
    url: `/occupation-bed/insertOccupationBed`,
    method: 'post',
    data: params
  })
}

// 科室预约统计
export function getDeptUsedBedReportDTO(params) {
  return request({
    url: `/dataSource/getDeptUsedBedReportDTO`,
    method: 'post',
    data: params
  })
}
// 科室预约统计下载
export function getDeptUsedBedReportDtoExcel(params) {
  return request({
    url: `/dataSource/getDeptUsedBedReportDtoExcel`,
    method: 'post',
    data: params,
    responseType: 'blob'
  })
}

// 切换床位类型
export function changeBedTypeAPI(params) {
  return request({
    url: '/this-ii-prepayin/changeBedType',
    method: 'POST',
    data: params
  })
}

export function selectCwInformation(params) {
  return request({
    url: 'this-ii-prepayin/selectCwInformation',
    method: 'POST',
    data: params
  })
}
export function changeBedTypeByNurseCode(params) {
  return request({
    url: `this-ii-prepayin/changeBedTypeByNurseCode?nurseCode=${params}`,
    method: 'get'
  })
}

export function getThisIiPrepayinByPreid(params) {
  return request({
    url: `this-ii-prepayin/getThisIiPrepayinByPreid`,
    method: 'get',
    params
  })
}
//预约
export function addPatientRjssBed(params) {
  return request({
    url: `patient-bed-middle-rjss/addPatientBed?bedId=${params.bedId}&preid=${params.preid}`,
    method: 'post'
  })
}
//取消预约床位
export function delPatientBed(params) {
  return request({
    url: `patient-bed-middle-rjss/delPatientBed?bedId=${params.bedId}&preid=${params.preid}`,
    method: 'post'
  })
}






